/**
 * 
 */
package com.nervytech.tutorcruise.profile.beans.builders;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.nervytech.tutorcruise.db.dao.model.CompanyProfile;
import com.nervytech.tutorcruise.db.service.interfaces.ICompanyProfileService;
import com.nervytech.tutorcruise.profile.beans.CompanyProfileBean;
import com.nervytech.tutorcruise.profile.beans.UserBean;
import com.nervytech.tutorcruise.service.exception.TrainerCruiseServiceException;

/**
 * @author ADMIN
 *
 */
@Component("companyProfileBeanBuilder")
public class CompanyProfileBeanBuilder implements IProfileBeanBuilder {
	
	@Autowired
	private ICompanyProfileService compProfileService;

	/* (non-Javadoc)
	 * @see com.nervytech.tutorcruise.profile.beans.builders.IProfileBeanBuilder#getProfileBean()
	 */
	@Override
	public UserBean getProfileBean(long userId) {
		// TODO Auto-generated method stub
		return null;
	}

	
	public <T extends UserBean> T getProfileBeanG(long userId)
			throws TrainerCruiseServiceException {
		
		CompanyProfile compProfile = compProfileService.getCompanyProfile(userId);
		
		CompanyProfileBean profileBean = new CompanyProfileBean();
		profileBean.setAboutCompany(compProfile.getAboutCompany());
		profileBean.setAddress(compProfile.getAddress());
		profileBean.setContactPersonName(compProfile.getContactPersonName());
		profileBean.setContactPersonEmail(compProfile.getContactPersonEmail());
		profileBean.setCategory(compProfile.getCategory());
		profileBean.setCity(compProfile.getCity());
		profileBean.setContactNumber(compProfile.getContactNumber());
		profileBean.setEmail(compProfile.getEmail());
		profileBean.setFullName(compProfile.getFullName());
		profileBean.setImageUrl(compProfile.getImageUrl());
		profileBean.setPhone(compProfile.getPhone());
		profileBean.setWebsite(compProfile.getWebsite());
		profileBean.setZipCode(compProfile.getZipCode());
		
		return (T)profileBean;
	}

}
